#include <iostream>
#include <pthread.h>
#include <cassert>
#include <unistd.h>
using namespace std;
void *thread_routine(void *args)
{
    while (1)
    {
        cout << "我是新线程" << endl;
        sleep(1);
    }
}
int main()
{
    pthread_t id;
    int n = pthread_create(&id, nullptr, thread_routine, (void *)"thread one");
    assert(n == 0);
    (void)n;
    while (1)
    {
        cout << "我是主线程" << endl;
        sleep(1);
    }
    return 0;
}